package com.rabbitmq.demo.consumer;

import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.util.Map;

@Component
public class DirectConsumer {
    @RabbitHandler
    @RabbitListener(queues = "contractQueue")// 监听的消息队列名称
    public void process(Map message){
        System.out.println("contractQueue消费者收到消息 : " + message.toString());
    }
}
